import fetch from 'common/src/utils/fetch'

let api = {
    // 查询列表
    getList(data) {
        return fetch({
            url: '/api/designservice/optWhiteList/queryByPage',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 查选课白名单详情
    getExpandDetail(data) {
        return fetch({
            url: '/api/designservice/optWhiteList/queryDetail',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 查学生信息详情
    getStudentInfo(data) {
        return fetch({
            url: '/api/designservice/optWhiteList/transCode',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 新增
    insert(data) {
        return fetch({
            url: '/api/designservice/optWhiteList/insert',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 编辑
    update(data) {
        return fetch({
            url: '/api/designservice/optWhiteList/update',
            method: 'put',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 删除
    delete(data) {
        return fetch({
            url: '/api/designservice/optWhiteList/delete',
            method: 'delete',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 导出
    export(data) {
        return fetch({
            url: '/api/designservice/optWhiteList/exportList',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    getExportStatus(key) {
        return fetch({
            url: `/api/designservice/common/exportExcelResult/${key}`,
            method: 'get',
            showMask: false
        })
    },
    // 查学院
    getCollege() {
        let authId = localStorage.getItem('activeAuthId')
        return fetch({
            url: `/api/designservice/common/college?authId=${authId}`,
            method: 'get',
            headers: {
                'Content-Type': 'application/json'
            }
        })
    },
    // 根据年份和学院查专业
    getSubject(data) {
        return fetch({
            url: '/api/designservice/common/findSubject',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 根据年级和专业查方向
    getDirection(data) {
        return fetch({
            url: '/api/commonservice/directionMainten/findDirectionMaintenList',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
}

export default api
